package com.redhat.redwork.widget.tree;

import java.util.List;

/**
 * Tree的data(数据)
 * 
 * @author tony.tan
 */
public class TreeNode {
	private String id; // 节点的ID
	private String text; // 节点的文字
	private boolean leaf; // 节点是否叶子节点
	private String href; // URL链接
	private boolean disabled = false; // 是否为不可选择
	private String title; // 鼠标滑过提示
	
	private List<TreeNode> childrend; // 子节点

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getHref() {
		return href;
	}

	public void setHref(String href) {
		this.href = href;
	}

	public boolean isLeaf() {
		return this.leaf;
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public String getTitle() {
		if(title == null || title.trim().length() == 0){
			return this.text;
		}
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public List<TreeNode> getChildrend() {
		return childrend;
	}

	public void setChildrend(List<TreeNode> childrend) {
		this.childrend = childrend;
	}

}
